/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.model;

import com.model.admin.LoginModelRemote;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 *
 * @author Tuan Long
 */
public class LoginController {   

    public String loginControl(String username, String password) {
        try {            
            InitialContext ictx = new InitialContext();
            LoginModelRemote loginRemote = (LoginModelRemote) ictx.lookup("java:global/BluePumpkinEJB/LoginModel!com.model.admin.LoginModelRemote");
            String name= loginRemote.loginControl(username, password);            
            return name;
        } catch (NamingException ex) {
            Logger.getLogger(LoginController.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }
    
}
